<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="/wondershare/js/jquery.js"></script> 
<script src="/wondershare/js/jquery.cvbox.min.js"></script> 
<script type="text/javascript" src="../images/unti.js"></script>
<link href="/wondershare/styles/main.css" rel="stylesheet" type="text/css" />
<link href="/wondershare/styles/general.css" rel="stylesheet" type="text/css" />
<title>Product Support栏目左侧链接管理编辑页</title>
<script>
$(document).ready(function(){
   $("#start_topic_cat_id").val($("#topic_cat_id").val());
}); 

function get_article_list(type)
 {
	var web_info = $("#web_info").val();
   var result = false;
   $.ajax({
        	    async:false,//要设置为同步的，要不CheckInputUrl的返回值永远为false
				type: "GET"
                ,url:'/wondershare/support_right_recommend.php?action=article_list'
                ,data:{type:'del_support_right',cat_id:$("#topic_cat_id").val()}
                ,success:function(data){
				 result = true;
	}});
	if(result)
	{
	   var topic_cat_id = $("#topic_cat_id").val();
	   if(topic_cat_id.replace(/(^\s*)|(\s*$)/g, "") == "")
	   {
		  alert('请先选择关联'+web_info+'文章Topic！');
		  return false;
	   }
	   if(type == 'key_article')
	   {
		 var recommend_id = $("#recommend_id").val();
		 jIframe('', '选择'+web_info+'关联的文章Topic', {
					width: 750,
					height: 345,
					src: '/wondershare/support_right_recommend.php?action=article_list&recommend_id='+
					recommend_id+'&topic_cat_id='+topic_cat_id+'&web_type='+$("#web_type").val(),
					ID: 'all_category_article',
					box_btn:true,
					callback:add_recommend_article
				});
	   }
   }
 
	
 }
 
 function add_recommend_article()
 {
 	var recommend_id = document.getElementById("all_category_article").contentWindow.get_checked_value();
	var recommend_title  = document.getElementById("all_category_article").contentWindow.get_checked_title();
	$("#recommend_article").val(recommend_title);
	$("#recommend_id").val(recommend_id);
	jClose();
 }
 function empty_article()
 {
     $("#recommend_id").val('');
	 $("#recommend_article").val('');
 }
</script>
</head>

<body  >
<h1>

<span class="action-span1">
<a href="/wondershare/support_right_recommend.php?action=index&web_type=<{$web_type}>" style="text-decoration:underline">侧边链接管理</a> 
</span>
<span id="search_id" class="action-span1"> - 修改</span>
<div style="clear:both"></div>
</h1>

<div id="tabbody-div"  style=" width:1100px;">
      <form  name="theForm" method="post" action="/wondershare/support_right_recommend.php?action=edit" >
        <table align="center" width="90%" id="general-table">
          <tbody>
		  <tr>
            <td class="label">类别名称：</td>
            <td> <b><{$category_info.two_cat_title}></b></td>
          </tr>
		  
		   <tr id="tr_co_rating" >
            <td class="label">关联<{$web_info}>文章Topic：</td>
            <td>
			<select name="topic_cat_id" style="width:350px;" id="topic_cat_id" onchange="empty_article();" >
			<{foreach from=$category_info.date item=rows}>
	            <option value="<{$rows.cat_id}>" <{if $rows.cat_id  == $category_info.topic_cat_id}> selected="selected" <{/if}> > <{$rows.cat_title}></option>
	        <{/foreach}>
	       </select>
			 </td>
          </tr>
		  <tr>
            <td class="label">关联Topic具体文章：</td>
  			<td>
			  <textarea cols="50" rows="10" id="recommend_article" name="recommend_article" disabled="disabled"><{$category_info.recommend_article|escape}></textarea>
			  <div style="float:right;">
			  Tips：<br>选择的重点文章将固定在该类别下的产品帮助页面展示。<br>可选择3~6篇关联文章，不足6篇的将随机出现。<br>
			  建议仅选择3篇重点推荐的文章。<br>
			  
			  <input type="button" onclick="get_article_list('key_article');" style="margin-left:20px; margin-top:80px; " name="get_info2" value="选择重点文章"></div>
              </td>
          </tr>        

        </tbody></table>

        <div  style="margin-left:380px; margin-top:20px;">
          <input type="hidden"  name="two_cat_id" value="<{$two_cat_id}>">
		  <input type="hidden"  name="start_topic_cat_id"  id="start_topic_cat_id" value="">
	      <input type="hidden" name="web_type" id="web_type" value="<{$web_type}>" />
           <input type="hidden" name="web_info" id="web_info" value="<{$web_info}>" />
		  <input type="hidden" name="recommend_id" id="recommend_id" value="<{$category_info.recommend_id}>" />
          <input type="submit"   class="button" value="确认" name="sub_from">
          <input type="reset" class="button" value=" 重置 ">
        </div>
      
      </form>
    </div>
</body>
</html>